home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / opttree.zip / OWL.ZIP / OTTSTAPP.CPP < prev    next >
C/C++ Source or Header  |  1995-01-03  |  20KB  |  783 lines

  1. /*  Project ottest
  2.     Freeman-Teresa Software
  3.     Copyright ⌐ 1994. All Rights Reserved.
  4.  
  5.     SUBSYSTEM:    ottest.exe Application
  6.     FILE:         ottstapp.cpp
  7.     AUTHOR:       Kent Tong
  8.  
  9.  
  10.     OVERVIEW
  11.     ========
  12.     Source file for implementation of ottestApp (TApplication).      
  13. */
  14.  
  15.  
  16. #include <owl\owlpch.h>
  17. #pragma hdrstop
  18.  
  19. #include "owl\static.h" 
  20.  
  21. #include "ottstapp.h"
  22. #include "ttstabtd.h"                        // Definition of about dialog.
  23.  
  24.  
  25. #ifndef __OPTTREE_H
  26. #include "opttree.h"
  27. #endif
  28.  
  29.  
  30. //{{ottestApp Implementation}}
  31.  
  32.  
  33. //
  34. // Build a response table for all messages/commands handled
  35. // by the application.
  36. //
  37. DEFINE_RESPONSE_TABLE1(ottestApp, TApplication)
  38. //{{ottestAppRSP_TBL_BEGIN}}
  39.     EV_COMMAND(CM_HELPABOUT, CmHelpAbout),
  40.     EV_COMMAND(CM_TEST1, CmTest1),
  41.     EV_COMMAND(CM_TEST2, CmTest2),
  42.     EV_COMMAND(CM_TEST3, CmTest3),
  43.     EV_COMMAND(CM_TEST7, CmTest7),
  44.     EV_COMMAND(CM_TEST8, CmTest8),
  45.     EV_COMMAND(CM_TEST6, CmTest6),
  46.     EV_COMMAND(CM_TEST4, CmTest4),
  47.     EV_COMMAND(CM_TEST5, CmTest5),
  48. //{{ottestAppRSP_TBL_END}}
  49. END_RESPONSE_TABLE;
  50.  
  51.  
  52. //
  53. // FrameWindow must be derived to override Paint for Preview and Print.
  54. //
  55. class SDIDecFrame : public TDecoratedFrame {
  56. public:
  57.     SDIDecFrame (TWindow *parent, const char far *title, TWindow *clientWnd, BOOL trackMenuSelection = FALSE, TModule *module = 0) :
  58.             TDecoratedFrame(parent, title, clientWnd, trackMenuSelection, module)
  59.       {  }
  60.     ~SDIDecFrame ()
  61.       {  }
  62. };
  63.  
  64.  
  65. //////////////////////////////////////////////////////////
  66. // ottestApp
  67. // =====
  68. //
  69. ottestApp::ottestApp () : TApplication("Option Tree Test")
  70. {
  71.  
  72.     // Common file file flags and filters for Open/Save As dialogs.  Filename and directory are
  73.     // computed in the member functions CmFileOpen, and CmFileSaveAs.
  74.     FileData.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
  75.     FileData.SetFilter("All Files (*.*)|*.*|");
  76.  
  77.     // INSERT>> Your constructor code here.
  78.  
  79. }
  80.  
  81.  
  82. ottestApp::~ottestApp ()
  83. {
  84.     // INSERT>> Your destructor code here.
  85.  
  86. }
  87.  
  88.  
  89. //////////////////////////////////////////////////////////
  90. // ottestApp
  91. // =====
  92. // Application intialization.
  93. //
  94. void ottestApp::InitMainWindow ()
  95. {
  96.     Client = new TWindow(0, "");
  97.     SDIDecFrame *frame = new SDIDecFrame(0, GetName(), Client, TRUE);
  98.  
  99.     nCmdShow = nCmdShow != SW_SHOWMINIMIZED ? SW_SHOWNORMAL : nCmdShow;
  100.  
  101.     //
  102.     // Assign ICON w/ this application.
  103.     //
  104.     frame->SetIcon(this, IDI_SDIAPPLICATION);
  105.  
  106.     //
  107.     // Menu associated with window and accelerator table associated with table.
  108.     //
  109.     frame->AssignMenu(SDI_MENU);
  110.     
  111.     //
  112.     // Associate with the accelerator table.
  113.     //
  114.     frame->Attr.AccelTable = SDI_MENU;
  115.  
  116.  
  117.     TStatusBar *sb = new TStatusBar(frame, TGadget::Recessed,
  118.                                     TStatusBar::CapsLock        |
  119.                                     TStatusBar::NumLock         |
  120.                                     TStatusBar::ScrollLock      |
  121.                                     TStatusBar::Overtype);
  122.     frame->Insert(*sb, TDecoratedFrame::Bottom);
  123.     MainWindow = frame;
  124.     EnableBWCC();
  125.     EnableCtl3d();
  126.     EnableCtl3dAutosubclass(1);
  127. }
  128.  
  129.  
  130. //////////////////////////////////////////////////////////
  131. // ottestApp
  132. // ===========
  133. // Menu File New command
  134. void ottestApp::CmFileNew ()
  135. {
  136. }
  137.  
  138.  
  139. //////////////////////////////////////////////////////////
  140. // ottestApp
  141. // ===========
  142. // Menu File Open command
  143. void ottestApp::CmFileOpen ()
  144. {
  145.     //
  146.     // Display standard Open dialog box to select a file name.
  147.     //
  148.     *FileData.FileName = 0;
  149.     if (Client->CanClose())
  150.         if (TFileOpenDialog(MainWindow, FileData).Execute() == IDOK)
  151.             OpenFile();
  152. }
  153.  
  154.  
  155. void ottestApp::OpenFile (const char *fileName)
  156. {
  157.     if (fileName)
  158.         lstrcpy(FileData.FileName, fileName);
  159.  
  160. }
  161.  
  162.  
  163. //////////////////////////////////////////////////////////
  164. // ottestApp
  165. // =====
  166. // Menu File Close command
  167. void ottestApp::CmFileClose ()
  168. {
  169. }
  170.  
  171.  
  172. //////////////////////////////////////////////////////////
  173. // ottestApp
  174. // ===========
  175. // Menu Help About ottest.exe command
  176. void ottestApp::CmHelpAbout ()
  177. {
  178.     //
  179.     // Show the modal dialog.
  180.     //
  181.     ottestAboutDlg(MainWindow).Execute();
  182. }
  183.  
  184.  
  185. int OwlMain (int , char* [])
  186. {
  187.     ottestApp     App;
  188.     int             result;
  189.  
  190.     result = App.Run();
  191.  
  192.     return result;
  193. }
  194.  
  195. class TMyOptNode:public TOptNode           /* provide a description text field */
  196. {
  197.    public:
  198.  
  199.    /* for leaf node */
  200.    TMyOptNode(char txt[], int isxcl, int chksti, int enable):TOptNode(txt, isxcl, chksti, enable)
  201.    {
  202.       setdesc(txt);
  203.    }
  204.  
  205.    /* for branch node */
  206.    TMyOptNode(char txt[], int isxcl, int isexp):TOptNode(txt, isxcl, isexp)
  207.    {
  208.       setdesc(txt);
  209.    }
  210.  
  211.    char desc[80];
  212.  
  213.    void setdesc(char descx[])
  214.    {
  215.       lstrcpy(desc, descx);
  216.    }
  217. };
  218.  
  219. class TMyOptTree:public TOptTree      /* provide our own notification handlers */
  220. {
  221.    public:
  222.  
  223.    TMyOptTree(TWindow *parent, int isshowdot = 1, int isindinv = 1):TOptTree(parent, isshowdot, isindinv)
  224.    {
  225.  
  226.    }
  227.    void notifyselchg(TOptNode *p);
  228. };
  229.  
  230. class TDlgTest1:public TDialog
  231. {
  232.    TOptTree *otc;
  233.  
  234.    public:
  235.  
  236.    TDlgTest1(TWindow *parent, TResID id, int cap);
  237.  
  238.    void SetupWindow();
  239.  
  240.    void CleanupWindow();
  241. };
  242.  
  243. class TDlgTest2:public TDialog
  244. {
  245.    TOptTree *otc;
  246.  
  247.    public:
  248.  
  249.    TDlgTest2(TWindow *parent, TResID id, int cap);
  250.  
  251.    void SetupWindow();
  252.  
  253.    void CleanupWindow();
  254. };
  255.  
  256. class TDlgTest3:public TDialog
  257. {
  258.    TOptTree *otc;
  259.  
  260.    public:
  261.  
  262.    TDlgTest3(TWindow *parent, TResID id, int cap);
  263.  
  264.    void SetupWindow();
  265.  
  266.    void CleanupWindow();
  267. };
  268.  
  269. class TDlgTest4:public TDialog
  270. {
  271.    TOptTree *otc;
  272.  
  273.    public:
  274.  
  275.    TDlgTest4(TWindow *parent, TResID id, int cap);
  276.  
  277.    void SetupWindow();
  278.  
  279.    void CleanupWindow();
  280. };
  281.  
  282. /* p is just selected */
  283. void TMyOptTree::notifyselchg(TOptNode *p)
  284. {
  285.    TMyOptNode *q;
  286.  
  287.    q = (TMyOptNode*)p;
  288.    TWindow dlg(GetParent());
  289.    TWindow desc(dlg.GetDlgItem(102));
  290.    desc.SetWindowText(q->desc);
  291. }
  292.  
  293. TDlgTest1::TDlgTest1(TWindow *parent, TResID id, int cap):TDialog(parent, id)
  294. {
  295.    TMyOptNode *p;
  296.    TMyOptNode *q;
  297.    TMyOptNode *r;
  298.    TMyOptNode *s;
  299.  
  300.    if (!cap)
  301.    {
  302.       otc = new TMyOptTree(this, 1);        /* will be deleted by the dlg */
  303.  
  304.       p = new TMyOptNode("Software Products", 0, 1);
  305.       p->setdesc("All software products available are listed here");
  306.       p->begappendkid();
  307.       {
  308.          q = new TMyOptNode("Lotus 123 for Windows", 0, 0, 1);
  309.          q->setdesc("Spreadsheet program from Lotus Corp.");
  310.          p->appendkid(q);
  311.  
  312.          q = new TMyOptNode("Microsoft Word",        0, 1, 1);
  313.          q->setdesc("Word Processor from Microsoft");
  314.          p->appendkid(q);
  315.  
  316.          q = new TMyOptNode("Borland C++",           0, 1, 0);
  317.          q->setdesc("C++ compiler with edge leading C++ features");
  318.          p->appendkid(q);
  319.  
  320.          q = new TMyOptNode("Choose One Utility", 0, 0);
  321.          q->setdesc("You can choose one of the utilities listed below");
  322.          q->begappendkid();
  323.          {
  324.             r = new TMyOptNode("Visual Calendar",           1, 1, 1);
  325.             r->setdesc("Utility keeping track of your appointments");
  326.             q->appendkid(r);
  327.  
  328.             r = new TMyOptNode("Norton Desktop", 1, 0);
  329.             r->setdesc("A set of powerful utilities from Symantec");
  330.             r->begappendkid();
  331.             {
  332.                s = new TMyOptNode("Norton Disk Doctor", 0, 0, 1);
  333.                s->setdesc("Program checking and/or fixing your hard disk");
  334.                r->appendkid(s);
  335.  
  336.                s = new TMyOptNode("Virtual Desktop",    0, 0, 1);
  337.                s->setdesc("Manages your desktop");
  338.                r->appendkid(s);
  339.  
  340.                s = new TMyOptNode("INI Assistant",      0, 0, 1);
  341.                s->setdesc("Helps you understand the profound Windows INI settings");
  342.                r->appendkid(s);
  343.             }
  344.             r->endappendkid();
  345.             q->appendkid(r);
  346.  
  347.             r = new TMyOptNode("Business Card for Windows", 1, 0, 1);
  348.             r->setdesc("A simple free form database");
  349.             q->appendkid(r);
  350.  
  351.             r = new TMyOptNode("MicroHelp Uninstaller",     1, 0, 1);
  352.             r->setdesc("Uninstalls all the nasty Windows applications");
  353.             q->appendkid(r);
  354.          }
  355.          q->endappendkid();
  356.          p->appendkid(q);
  357.  
  358.          q = new TMyOptNode("Visual C++",        0, 1, 1);
  359.          q->setdesc("C++ compiler from Microsoft");
  360.          p->appendkid(q);
  361.       }
  362.       p->endappendkid();
  363.       otc->begappendroot();
  364.       otc->appendroot(p);
  365.       otc->endappendroot();
  366.    }
  367.    else
  368.    {
  369.       int i;
  370.       int j;
  371.       char b[20];
  372.  
  373.       otc = new TMyOptTree(this, 1, 0);               /* invalidate as a whole */
  374.  
  375.       otc->begappendroot();
  376.  
  377.       for (i = 0; i < 10; i++)
  378.       {
  379.          wsprintf(b, "%5d-%5d", i*1000, (i+1)*1000-1);
  380.  
  381.          p = new TMyOptNode(b, 0, 0);
  382.  
  383.          p->begappendkid();
  384.  
  385.          for (j = 0; j < 1000; j++)
  386.          {
  387.             wsprintf(b, "%5d", i*1000+j);
  388.  
  389.             q = new TMyOptNode(b, 0, 1, 1);
  390.  
  391.             p->appendkid(q);
  392.          }
  393.          p->endappendkid();
  394.  
  395.          otc->appendroot(p);
  396.       }
  397.       otc->endappendroot();
  398.    }
  399. }
  400.  
  401. void TDlgTest1::SetupWindow()
  402. {
  403.    TDialog::SetupWindow();
  404.    otc->create(102, 101);
  405.    SetWindowText("Test1 - Option Tree");
  406. }
  407.  
  408. void TDlgTest1::CleanupWindow()
  409. {
  410.    otc->freeallnodes();
  411.  
  412.    TDialog::CleanupWindow();
  413. }
  414.  
  415. TDlgTest2::TDlgTest2(TWindow *parent, TResID id, int cap):TDialog(parent, id)
  416. {
  417.    TMyOptNode *q;
  418.  
  419.    otc = new TMyOptTree(this, 0);        /* will be deleted by the dlg */
  420.  
  421.    if (!cap)
  422.    {
  423.       otc->begappendroot();
  424.  
  425.       q = new TMyOptNode("Lotus 123 for Windows",     0, 1, 1);
  426.       q->setdesc("Spreadsheet program from Lotus Corp.");
  427.       otc->appendroot(q);
  428.  
  429.       q = new TMyOptNode("Microsoft Word",            0, 0, 1);
  430.       q->setdesc("Word Processor from Microsoft");
  431.       otc->appendroot(q);
  432.  
  433.       q = new TMyOptNode("Borland C++",               0, 0, 1);
  434.       q->setdesc("C++ compiler with edge leading C++ features");
  435.       otc->appendroot(q);
  436.  
  437.       q = new TMyOptNode("Visual Calendar",           0, 1, 1);
  438.       q->setdesc("Utility keeping track of your appointments");
  439.       otc->appendroot(q);
  440.  
  441.       q = new TMyOptNode("Business Card for Windows", 0, 0, 1);
  442.       q->setdesc("A simple free form database");
  443.       otc->appendroot(q);
  444.  
  445.       q = new TMyOptNode("Visual C++",                0, 1, 1);
  446.       q->setdesc("C++ compiler from Microsoft");
  447.       otc->appendroot(q);
  448.  
  449.       q = new TMyOptNode("Freeman Installer",         0, 0, 1);
  450.       q->setdesc("A powerful install utility from Freeman-Teresa Software");
  451.       otc->appendroot(q);
  452.  
  453.       q = new TMyOptNode("Adobe PhotoShop",           0, 1, 1);
  454.       q->setdesc("A very popular image processor");
  455.       otc->appendroot(q);
  456.  
  457.       q = new TMyOptNode("Delphi",                    0, 0, 1);
  458.       q->setdesc("A very high level client-server database development tool");
  459.       otc->appendroot(q);
  460.  
  461.       q = new TMyOptNode("DOOM",                      0, 1, 1);
  462.       q->setdesc("An exciting 3D action game from ID Software");
  463.       otc->appendroot(q);
  464.  
  465.       q = new TMyOptNode("PagePlus",                  0, 1, 1);
  466.       q->setdesc("A FREE DTP program");
  467.       otc->appendroot(q);
  468.  
  469.       q = new TMyOptNode("AusTax",                    0, 0, 1);
  470.       q->setdesc("Helps you reduce your tax payment");
  471.       otc->appendroot(q);
  472.  
  473.       q = new TMyOptNode("CIM",                       0, 1, 1);
  474.       q->setdesc("CompuServe Information Manager");
  475.       otc->appendroot(q);
  476.  
  477.       otc->endappendroot();
  478.    }
  479.    else
  480.    {
  481.       int i;
  482.       char b[10];
  483.  
  484.       otc->begappendroot();
  485.  
  486.       for (i = 0; i < 10000; i++)
  487.       {
  488.          wsprintf(b, "Node %d", i);
  489.          q = new TMyOptNode(b, 0, 1, 1);
  490.          otc->appendroot(q);
  491.       }
  492.       otc->endappendroot();
  493.    }
  494. }
  495.  
  496. void TDlgTest2::SetupWindow()
  497. {
  498.    TDialog::SetupWindow();
  499.    otc->create(102, 101);
  500.    SetWindowText("Test2 - Option List");
  501. }
  502.  
  503. void TDlgTest2::CleanupWindow()
  504. {
  505.    otc->freeallnodes();
  506.  
  507.    TDialog::CleanupWindow();
  508. }
  509.  
  510. TDlgTest3::TDlgTest3(TWindow *parent, TResID id, int cap):TDialog(parent, id)
  511. {
  512.    TMyOptNode *p;
  513.    TMyOptNode *q;
  514.    TMyOptNode *r;
  515.    TMyOptNode *s;
  516.  
  517.    otc = new TMyOptTree(this, 1);        /* will be deleted by the dlg */
  518.  
  519.    if (!cap)                                                /* default */
  520.    {
  521.       p = new TMyOptNode("Software Products", 0, 1);
  522.       p->setdesc("All software products available are listed here");
  523.       p->begappendkid();
  524.       {
  525.          q = new TMyOptNode("Lotus 123 for Windows", 0, 0, 2);
  526.          q->setdesc("Spreadsheet program from Lotus Corp.");
  527.          p->appendkid(q);
  528.  
  529.          q = new TMyOptNode("Microsoft Word",        0, 1, 2);
  530.          q->setdesc("Word Processor from Microsoft");
  531.          p->appendkid(q);
  532.  
  533.          q = new TMyOptNode("Borland C++",           0, 1, 2);
  534.          q->setdesc("C++ compiler with edge leading C++ features");
  535.          p->appendkid(q);
  536.  
  537.          q = new TMyOptNode("Choose One Utility", 0, 0);
  538.          q->setdesc("You can choose one of the utilities listed below");
  539.          q->begappendkid();
  540.          {
  541.             r = new TMyOptNode("Visual Calendar",           1, 1, 2);
  542.             r->setdesc("Utility keeping track of your appointments");
  543.             q->appendkid(r);
  544.  
  545.             r = new TMyOptNode("Norton Desktop", 1, 0);
  546.             r->setdesc("A set of powerful utilities from Symantec");
  547.             r->begappendkid();
  548.             {
  549.                s = new TMyOptNode("Norton Disk Doctor", 0, 0, 2);
  550.                s->setdesc("Program checking and/or fixing your hard disk");
  551.                r->appendkid(s);
  552.  
  553.                s = new TMyOptNode("Virtual Desktop",    0, 0, 2);
  554.                s->setdesc("Manages your desktop");
  555.                r->appendkid(s);
  556.  
  557.                s = new TMyOptNode("INI Assistant",      0, 0, 2);
  558.                s->setdesc("Helps you understand the profound Windows INI settings");
  559.                r->appendkid(s);
  560.             }
  561.             r->endappendkid();
  562.             q->appendkid(r);
  563.  
  564.             r = new TMyOptNode("Business Card for Windows", 1, 0, 2);
  565.             r->setdesc("A simple free form database");
  566.             q->appendkid(r);
  567.  
  568.             r = new TMyOptNode("MicroHelp Uninstaller",     1, 0, 2);
  569.             r->setdesc("Uninstalls all the nasty Windows applications");
  570.             q->appendkid(r);
  571.          }
  572.          q->endappendkid();
  573.          p->appendkid(q);
  574.  
  575.          q = new TMyOptNode("Visual C++",        0, 1, 2);
  576.          q->setdesc("C++ compiler from Microsoft");
  577.          p->appendkid(q);
  578.       }
  579.       p->endappendkid();
  580.       otc->begappendroot();
  581.       otc->appendroot(p);
  582.       otc->endappendroot();
  583.    }
  584.    else
  585.    {
  586.       int i;
  587.       int j;
  588.       char b[20];
  589.  
  590.       otc->begappendroot();
  591.  
  592.       for (i = 0; i < 10; i++)
  593.       {
  594.          wsprintf(b, "%5d-%5d", i*1000, (i+1)*1000-1);
  595.  
  596.          p = new TMyOptNode(b, 0, 0);
  597.  
  598.          p->begappendkid();
  599.  
  600.          for (j = 0; j < 1000; j++)
  601.          {
  602.             wsprintf(b, "%5d", i*1000+j);
  603.  
  604.             q = new TMyOptNode(b, 0, 1, 2);
  605.  
  606.             p->appendkid(q);
  607.          }
  608.          p->endappendkid();
  609.  
  610.          otc->appendroot(p);
  611.       }
  612.       otc->endappendroot();
  613.    }
  614. }
  615.  
  616. void TDlgTest3::SetupWindow()
  617. {
  618.    TDialog::SetupWindow();
  619.    otc->create(102, 101);
  620.    SetWindowText("Test3 - Tree View");
  621. }
  622.  
  623. void TDlgTest3::CleanupWindow()
  624. {
  625.    otc->freeallnodes();
  626.  
  627.    TDialog::CleanupWindow();
  628. }
  629.  
  630. TDlgTest4::TDlgTest4(TWindow *parent, TResID id, int cap):TDialog(parent, id)
  631. {
  632.    TMyOptNode *q;
  633.  
  634.    otc = new TMyOptTree(this, 0);
  635.  
  636.    if (!cap)
  637.    {
  638.       otc->begappendroot();
  639.  
  640.       q = new TMyOptNode("Lotus 123 for Windows",     0, 0, 2);
  641.       q->setdesc("Spreadsheet program from Lotus Corp.");
  642.       otc->appendroot(q);
  643.  
  644.       q = new TMyOptNode("Microsoft Word",            0, 0, 2);
  645.       q->setdesc("Word Processor from Microsoft");
  646.       otc->appendroot(q);
  647.  
  648.       q = new TMyOptNode("Borland C++",               0, 0, 2);
  649.       q->setdesc("C++ compiler with edge leading C++ features");
  650.       otc->appendroot(q);
  651.  
  652.       q = new TMyOptNode("Visual Calendar",           0, 0, 2);
  653.       q->setdesc("Utility keeping track of your appointments");
  654.       otc->appendroot(q);
  655.  
  656.       q = new TMyOptNode("Business Card for Windows", 0, 0, 2);
  657.       q->setdesc("A simple free form database");
  658.       otc->appendroot(q);
  659.  
  660.       q = new TMyOptNode("Visual C++",                0, 0, 2);
  661.       q->setdesc("C++ compiler from Microsoft");
  662.       otc->appendroot(q);
  663.  
  664.       q = new TMyOptNode("Freeman Installer",         0, 0, 2);
  665.       q->setdesc("A powerful install utility from Freeman-Teresa Software");
  666.       otc->appendroot(q);
  667.  
  668.       q = new TMyOptNode("Adobe PhotoShop",           0, 0, 2);
  669.       q->setdesc("A very popular image processor");
  670.       otc->appendroot(q);
  671.  
  672.       q = new TMyOptNode("Delphi",                    0, 0, 2);
  673.       q->setdesc("A very high level client-server database development tool");
  674.       otc->appendroot(q);
  675.  
  676.       q = new TMyOptNode("DOOM",                      0, 0, 2);
  677.       q->setdesc("An exciting 3D action game from ID Software");
  678.       otc->appendroot(q);
  679.  
  680.       q = new TMyOptNode("PagePlus",                  0, 0, 2);
  681.       q->setdesc("A FREE DTP program");
  682.       otc->appendroot(q);
  683.  
  684.       q = new TMyOptNode("AusTax",                    0, 0, 2);
  685.       q->setdesc("Helps you reduce your tax payment");
  686.       otc->appendroot(q);
  687.  
  688.       q = new TMyOptNode("CIM",                       0, 0, 2);
  689.       q->setdesc("CompuServe Information Manager");
  690.       otc->appendroot(q);
  691.  
  692.       otc->endappendroot();
  693.    }
  694.    else
  695.    {
  696.       int i;
  697.       char b[10];
  698.  
  699.       otc->begappendroot();
  700.  
  701.       for (i = 0; i < 10000; i++)
  702.       {
  703.          wsprintf(b, "Node %d", i);
  704.          q = new TMyOptNode(b, 0, 0, 2);
  705.          otc->appendroot(q);
  706.       }
  707.       otc->endappendroot();
  708.    }
  709. }
  710.  
  711. void TDlgTest4::SetupWindow()
  712. {
  713.    TDialog::SetupWindow();
  714.    otc->create(102, 101);
  715.    SetWindowText("Test4 - List Box");
  716. }
  717.  
  718. void TDlgTest4::CleanupWindow()
  719. {
  720.    otc->freeallnodes();
  721.  
  722.    TDialog::CleanupWindow();
  723. }
  724.  
  725. void ottestApp::CmTest1 ()
  726. {
  727.     // INSERT>> Your code here.
  728.    TDlgTest1(GetMainWindow(), "dlgtest", 0).Execute();
  729. }
  730.  
  731.  
  732. void ottestApp::CmTest2 ()
  733. {
  734.     // INSERT>> Your code here.
  735.    TDlgTest2(GetMainWindow(), "dlgtest", 0).Execute();
  736. }
  737.  
  738.  
  739. void ottestApp::CmTest3 ()
  740. {
  741.     // INSERT>> Your code here.
  742.    TDlgTest3(GetMainWindow(), "dlgtest", 0).Execute();
  743.  
  744. }
  745.  
  746.  
  747. void ottestApp::CmTest4 ()
  748. {
  749.     // INSERT>> Your code here.
  750.    TDlgTest4(GetMainWindow(), "dlgtest", 0).Execute();
  751. }
  752.  
  753.  
  754. void ottestApp::CmTest5 ()
  755. {
  756.     // INSERT>> Your code here.
  757.    TDlgTest1(GetMainWindow(), "dlgtest", 1).Execute();
  758. }
  759.  
  760. void ottestApp::CmTest6 ()
  761. {
  762.     // INSERT>> Your code here.
  763.    TDlgTest2(GetMainWindow(), "dlgtest", 1).Execute();
  764. }
  765.  
  766.  
  767. void ottestApp::CmTest7 ()
  768. {
  769.     // INSERT>> Your code here.
  770.    TDlgTest3(GetMainWindow(), "dlgtest", 1).Execute();
  771.  
  772. }
  773.  
  774.  
  775. void ottestApp::CmTest8 ()
  776. {
  777.     // INSERT>> Your code here.
  778.    TDlgTest4(GetMainWindow(), "dlgtest", 1).Execute();
  779.  
  780. }
  781.  
  782.  
  783.